import request from '@/utils/request'

let cachedSchoolList = null
export function getList() {
  if (cachedSchoolList) {
    return Promise.resolve(cachedSchoolList)
  }
  return request({
    url: '/boyi/school/getList',
    method: 'get',
  }).then((response) => {
    cachedSchoolList = response
    return response
  })
}

export function doEdit(data: any) {
  return request({
    url: '/boyi/school/doEdit',
    method: 'post',
    data,
  })
}

export function doDelete(data: any) {
  return request({
    url: '/boyi/school/doDelete',
    method: 'post',
    data,
  })
}
